package Try;

public class Test1 {
    private static int f1(int num) {
        int count = 0;
        while (num > 0) {
            if (num % 10 == 9) {
                count++;
            }
            num /= 10;
        }
        return count;
    }

    public static void main(String[] args) {
        int count = 0;
        for (int i = 1; i <= 100; i++) {
            count += f1(i);
        }
        System.out.println(count);
    }
}
